#!/bin/bash
echo 'installing...'

if [[ -d ~/.config/zsh ]];then
	echo '~/.config/zsh/ Directory already exists, install exit'
else 
	mkdir ~/.config/zsh
	echo '~/.config/zsh/ Directory created'
fi

if git version | grep -q "git version" ; then
	echo 'Start cloning plugin'
	git clone https://gitee.com/angrylid/z-plugin.git ~/.config/zsh/z
	git clone https://gitee.com/angrylid/zsh-autosuggestions.git ~/.config/zsh/autosuggestions
	git clone https://gitee.com/angrylid/fast-syntax-highlighting.git ~/.config/zsh/highlighting
	git clone https://gitee.com/angrylid/config-sync.git ~/.config/config-sync
	echo 'downloaded'
else 
	echo 'git may not be installed, please install it first'
fi

if [[ ! -d ~/.config/zsh/theme/ ]]; then
	cp -r ~/.config/config-sync/theme/ ~/.config/zsh/theme/
fi

cp ~/.config/config-sync/.zshrc ~/.zshrc

echo 'finished'